﻿using SD.Infrastructure.AppServiceBase;
using SD.Infrastructure.DTOBase;
using SlamDunk.MES.IAppService.DTOs.Inputs;
using SlamDunk.MES.IAppService.DTOs.Outputs.QualityContext;
using SlamDunk.ValueObjects.Enums;
using System;
using System.Collections.Generic;
using System.ServiceModel;

namespace SlamDunk.MES.IAppService.Interfaces
{
    /// <summary>
    /// 质量管理服务契约接口
    /// </summary>
    [ServiceContract]
    public interface IQualityContract : IApplicationService
    {
        //命令部分

        #region # 创建作业计划质量检查 —— void CreateExecutionPlanInspect(string inspectionNo...
        /// <summary>
        /// 创建作业计划质量检查
        /// </summary>
        /// <param name="inspectionNo">质量检查编号</param>
        /// <param name="inspectionName">质量检查名称</param>
        /// <param name="inspectedDate">质检日期</param>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="description">描述</param>
        /// <param name="detailParams">质量检查明细参数模型集</param>
        [OperationContract]
        void CreateExecutionPlanInspect(string inspectionNo, string inspectionName, DateTime inspectedDate, Guid executionPlanId, string description, IEnumerable<QualityInspectionDetailParam> detailParams);
        #endregion

        #region # 创建工单质量检查 —— void CreateWorkOrderInspect(string inspectionNo...
        /// <summary>
        /// 创建工单质量检查
        /// </summary>
        /// <param name="inspectionNo">质量检查编号</param>
        /// <param name="inspectionName">质量检查名称</param>
        /// <param name="inspectedDate">质检日期</param>
        /// <param name="workOrderId">工单Id</param>
        /// <param name="description">描述</param>
        /// <param name="detailParams">质量检查明细参数模型集</param>
        [OperationContract]
        void CreateWorkOrderInspect(string inspectionNo, string inspectionName, DateTime inspectedDate, Guid workOrderId, string description, IEnumerable<QualityInspectionDetailParam> detailParams);
        #endregion

        #region # 修改质量检查 —— void UpdateQualityInspection(Guid qualityInspectionId...
        /// <summary>
        /// 修改质量检查
        /// </summary>
        /// <param name="qualityInspectionId">质量检查Id</param>
        /// <param name="inspectionName">质量检查名称</param>
        /// <param name="inspectedDate">质检日期</param>
        /// <param name="description">描述</param>
        /// <param name="detailParams">质量检查明细参数模型集</param>
        [OperationContract]
        void UpdateQualityInspection(Guid qualityInspectionId, string inspectionName, DateTime inspectedDate, string description, IEnumerable<QualityInspectionDetailParam> detailParams);
        #endregion

        #region # 删除质量检查 —— void RemoveQualityInspection(Guid qualityInspectionId)
        /// <summary>
        /// 删除质量检查
        /// </summary>
        /// <param name="qualityInspectionId">质量检查Id</param>
        [OperationContract]
        void RemoveQualityInspection(Guid qualityInspectionId);
        #endregion

        #region # 提交审核质量检查 —— void SubmitQualityInspection(Guid qualityInspectionId)
        /// <summary>
        /// 提交审核质量检查
        /// </summary>
        /// <param name="qualityInspectionId">质量检查Id</param>
        [OperationContract]
        void SubmitQualityInspection(Guid qualityInspectionId);
        #endregion

        #region # 批量提交审核质量检查 —— void SubmitQualityInspections(IEnumerable<Guid>...
        /// <summary>
        /// 批量提交审核质量检查
        /// </summary>
        /// <param name="qualityInspectionIds">质量检查Id集</param>
        [OperationContract]
        void SubmitQualityInspections(IEnumerable<Guid> qualityInspectionIds);
        #endregion

        #region # 审核质量检查 —— void CheckQualityInspection(Guid qualityInspectionId...
        /// <summary>
        /// 审核质量检查
        /// </summary>
        /// <param name="qualityInspectionId">质量检查Id</param>
        /// <param name="passed">是否通过</param>
        /// <param name="checkedRemark">审核意见</param>
        [OperationContract]
        void CheckQualityInspection(Guid qualityInspectionId, bool passed, string checkedRemark);
        #endregion


        //查询部分

        #region # 分页获取作业计划质量检查列表 —— PageModel<ExecutionPlanInspectionInfo> GetExecutionPlanInspectionsByPage(...
        /// <summary>
        /// 分页获取作业计划质量检查列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="checkStatus">审核状态</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <returns>作业计划质量检查列表</returns>
        [OperationContract]
        PageModel<ExecutionPlanInspectionInfo> GetExecutionPlanInspectionsByPage(string keywords, Guid? executionPlanId, CheckStatus? checkStatus, DateTime? startTime, DateTime? endTime, int pageIndex, int pageSize);
        #endregion

        #region # 分页获取工单质量检查列表 —— PageModel<WorkOrderInspectionInfo> GetWorkOrderInspectionsByPage(...
        /// <summary>
        /// 分页获取工单质量检查列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="workOrderId">工单Id</param>
        /// <param name="checkStatus">审核状态</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <returns>工单质量检查列表</returns>
        [OperationContract]
        PageModel<WorkOrderInspectionInfo> GetWorkOrderInspectionsByPage(string keywords, Guid? executionPlanId, Guid? workOrderId, CheckStatus? checkStatus, DateTime? startTime, DateTime? endTime, int pageIndex, int pageSize);
        #endregion

        #region # 获取质量检查明细列表 —— IEnumerable<QualityInspectionDetailInfo> GetQualityInspectionDetails(...
        /// <summary>
        /// 获取质量检查明细列表
        /// </summary>
        /// <param name="qualityInspectionId">质量检查Id</param>
        /// <returns>质量检查明细列表</returns>
        [OperationContract]
        IEnumerable<QualityInspectionDetailInfo> GetQualityInspectionDetails(Guid qualityInspectionId);
        #endregion
    }
}
